package by.yativem.commons.console.devices;

import java.io.Console;

public class SystemConsoleDevice implements ITextDevice {
	private final Console console ;
	
	
	public SystemConsoleDevice(){
		console =System.console();
	}	
	
	@Override
	public String readLine() throws ConsoleException {
		return console.readLine();
	}

	@Override
	public char[] readPassword() throws ConsoleException {
		return console.readPassword();
	}

	

	@Override
	public void write(String str) throws ConsoleException {
		console.printf(str);
	}

	@Override
	public void write(String fmt, Object... params) throws ConsoleException {
		console.printf(fmt, params);

	}
}